home *** CD-ROM | disk | FTP | other *** search
-
-
-
- GGGGEEEETTTTSSSSEEEERRRRVVVVEEEENNNNTTTT((((3333NNNN)))) GGGGEEEETTTTSSSSEEEERRRRVVVVEEEENNNNTTTT((((3333NNNN))))
-
-
-
- NNNNAAAAMMMMEEEE
- getservent, getservent_r, fgetservent, fgetservent_r, getservbyport,
- getservbyport_r, getservbyname, getservbyname_r, setservent, endservent -
- get service entry
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<nnnneeeettttddddbbbb....hhhh>>>>
-
- ssssttttrrrruuuucccctttt sssseeeerrrrvvvveeeennnntttt ****ggggeeeettttsssseeeerrrrvvvveeeennnntttt((((vvvvooooiiiidddd))));;;;
-
- ssssttttrrrruuuucccctttt sssseeeerrrrvvvveeeennnntttt ****ggggeeeettttsssseeeerrrrvvvveeeennnntttt____rrrr((((ssssttttrrrruuuucccctttt sssseeeerrrrvvvveeeennnntttt ****eeeennnnttttrrrryyyy,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuuffffssssiiiizzzzeeee))));;;;
-
- ssssttttrrrruuuucccctttt sssseeeerrrrvvvveeeennnntttt ****ffffggggeeeettttsssseeeerrrrvvvveeeennnntttt((((FFFFIIIILLLLEEEE ****))));;;;
-
- ssssttttrrrruuuucccctttt sssseeeerrrrvvvveeeennnntttt ****ffffggggeeeettttsssseeeerrrrvvvveeeennnntttt____rrrr((((FFFFIIIILLLLEEEE ****,,,, ssssttttrrrruuuucccctttt sssseeeerrrrvvvveeeennnntttt ****eeeennnnttttrrrryyyy,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuuffffssssiiiizzzzeeee))));;;;
-
- ssssttttrrrruuuucccctttt sssseeeerrrrvvvveeeennnntttt ****ggggeeeettttsssseeeerrrrvvvvbbbbyyyynnnnaaaammmmeeee((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****nnnnaaaammmmeeee,,,, ccccoooonnnnsssstttt cccchhhhaaaarrrr ****pppprrrroooottttoooo))));;;;
-
- ssssttttrrrruuuucccctttt sssseeeerrrrvvvveeeennnntttt ****ggggeeeettttsssseeeerrrrvvvvbbbbyyyynnnnaaaammmmeeee____rrrr((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****nnnnaaaammmmeeee,,,, ccccoooonnnnsssstttt cccchhhhaaaarrrr ****pppprrrroooottttoooo,,,, ssssttttrrrruuuucccctttt sssseeeerrrrvvvveeeennnntttt ****eeeennnnttttrrrryyyy,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuuffffssssiiiizzzzeeee))));;;;
-
- ssssttttrrrruuuucccctttt sssseeeerrrrvvvveeeennnntttt ****ggggeeeettttsssseeeerrrrvvvvbbbbyyyyppppoooorrrrtttt((((iiiinnnntttt ppppoooorrrrtttt,,,, ccccoooonnnnsssstttt cccchhhhaaaarrrr ****pppprrrroooottttoooo))));;;;
-
- ssssttttrrrruuuucccctttt sssseeeerrrrvvvveeeennnntttt ****ggggeeeettttsssseeeerrrrvvvvbbbbyyyyppppoooorrrrtttt____rrrr((((iiiinnnntttt ppppoooorrrrtttt,,,, ccccoooonnnnsssstttt cccchhhhaaaarrrr ****pppprrrroooottttoooo,,,, ssssttttrrrruuuucccctttt sssseeeerrrrvvvveeeennnntttt ****eeeennnnttttrrrryyyy,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuuffffssssiiiizzzzeeee))));;;;
-
- vvvvooooiiiidddd sssseeeettttsssseeeerrrrvvvveeeennnntttt((((iiiinnnntttt ssssttttaaaayyyyooooppppeeeennnn))));;;;
-
- vvvvooooiiiidddd eeeennnnddddsssseeeerrrrvvvveeeennnntttt((((vvvvooooiiiidddd))));;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- _g_e_t_s_e_r_v_e_n_t, _g_e_t_s_e_r_v_b_y_n_a_m_e, _g_e_t_s_e_r_v_b_y_p_o_r_t and their reentrant counterparts
- each return a pointer to an object with the following structure
- containing the broken-out fields of a line in the file /_e_t_c/_s_e_r_v_i_c_e_s, or
- some other back-end database.
-
- struct servent {
- char *s_name; /* official name of service */
- char **s_aliases; /* alias list */
- int s_port; /* port service resides at */
- char *s_proto; /* protocol to use */
- };
-
- The members of this structure are:
-
- s_name The official name of the service.
-
- s_aliases A zero terminated list of alternate names for the service.
-
- s_port The port number at which the service resides. Port numbers
- are returned as a 16-bit value in network byte order.
-
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- GGGGEEEETTTTSSSSEEEERRRRVVVVEEEENNNNTTTT((((3333NNNN)))) GGGGEEEETTTTSSSSEEEERRRRVVVVEEEENNNNTTTT((((3333NNNN))))
-
-
-
- s_proto The name of the protocol to use when contacting the service.
-
- _G_e_t_s_e_r_v_e_n_t reads the next line of the file, opening the file if
- necessary.
-
- _S_e_t_s_e_r_v_e_n_t opens and rewinds the file. If the _s_t_a_y_o_p_e_n flag is non-zero,
- the net data base will not be closed after each call to _g_e_t_s_e_r_v_b_y_n_a_m_e or
- _g_e_t_s_e_r_v_b_y_p_o_r_t.
-
- _E_n_d_s_e_r_v_e_n_t closes the file.
-
- _G_e_t_s_e_r_v_b_y_n_a_m_e and _g_e_t_s_e_r_v_b_y_p_o_r_t sequentially search from the beginning of
- the file until a matching protocol name or port number is found, or until
- EOF is encountered. If a protocol name is also supplied (non-NULL),
- searches must also match the protocol.
-
- The routines fgetservent and fgetservent_r return the next entry from the
- supplied stream as a struct servent structure. The stream must be of the
- same format as the file /_e_t_c/_s_e_r_v_i_c_e_s.
-
- The functions getservent, fgetservent, getservbyname and getservbyport
- all return results in static memory which are overwritten on each call.
- Reentrant versions of each of these routines getservent_r, fgetservent_t,
- getservbyname_r and getservbyport_r are provided to parse the results
- into supplied memory. They take three extra arguments, a pointer to a
- struct servent structure, a pointer to a character buffer, and a length
- for the buffer.
-
- The functions presented in this manual page only parse files of the
- format given in services(4). Other back-end databases and protocols,
- such as NIS, can be supplied by the nsd(1M) daemon as specified in the
- nsd configuration file /_e_t_c/_n_s_s_w_i_t_c_h._c_o_n_f.
-
- NNNNOOOOTTTTEEEE
- The Mips ABI specifies nothing but local files so applications which wish
- to use anything else must compile with libc prior to libnsl in the
- library list.
-
- When nsd is running changes in the local services file may not be noticed
- by getservent() until the enumeration cache file has timed out.
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- All functions that return struct servent * will return a null (0) pointer
- in the case of EOF or failure.
-
- FFFFIIIILLLLEEEESSSS
- /etc/services /etc/nsswitch.conf /var/ns/cache/services.byname.m
- /var/ns/cache/services.byport.m
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- GGGGEEEETTTTSSSSEEEERRRRVVVVEEEENNNNTTTT((((3333NNNN)))) GGGGEEEETTTTSSSSEEEERRRRVVVVEEEENNNNTTTT((((3333NNNN))))
-
-
-
- SEE ALSO
- nsd(1M), getprotoent(3N), services(4)
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- Null pointer (0) returned on EOF or error.
-
- BBBBUUUUGGGGSSSS
- Expecting port numbers to fit in a 32-bit quantity is probably naive.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-